package com.igeek.config.way2;

import org.springframework.context.support.GenericApplicationContext;

/**
 * TODO
 *
 * @author chh
 * @since 2024/5/20
 **/
public class GenericTest {
    public static void main(String[] args) {
        //获取IOC容器
        GenericApplicationContext gc=new GenericApplicationContext();

        //bean实例的注册
        gc.registerBean("person",Person.class,Person::new);

        //刷新
        gc.refresh();

        String[] arr=gc.getBeanDefinitionNames();
        int sum=gc.getBeanDefinitionCount();
        if(sum==arr.length)
        {
            System.out.println("true");
        }
    }
}
